/**
 * @author lteng
 * @time 2022-06-17 19:09:55 
 */
 
package liteng.study.cn.stuscore.service.impl;

import java.util.List;

import liteng.study.cn.stuscore.comm.Page;
import liteng.study.cn.stuscore.dao.ETypeDao;
import liteng.study.cn.stuscore.dao.impl.ETypeDaoImpl;
import liteng.study.cn.stuscore.entity.EType;
import liteng.study.cn.stuscore.service.ETypeService;

/**
 * 考试类型信息业务实现
 */
public class ETypeServiceImpl implements ETypeService {

	private ETypeDao eTypeDao = new ETypeDaoImpl();

	@Override
	public void add(EType eType) {
		// TODO Auto-generated method stub
		eTypeDao.add(eType);
	}

	@Override
	public void update(EType eType) {
		// TODO Auto-generated method stub
		eTypeDao.update(eType);
	}

	@Override
	public void delete(EType eType) {
		// TODO Auto-generated method stub
		eTypeDao.delete(eType);

	}

	@Override
	public EType getOne(int id) {
		// TODO Auto-generated method stub
		EType eType = eTypeDao.qryOne(id);
		return eType;
	}

	@Override
	public boolean isExistEType(String name) {
		// TODO Auto-generated method stub
		EType eType = eTypeDao.qryETypeByName(name);
		return eType == null ? false : true;
	}

	@Override
	public EType getETypeByName(String name) {
		// TODO Auto-generated method stub
		EType eType = eTypeDao.qryETypeByName(name);
		return eType;
	}

	@Override
	public Page getPageETypes(int padeIndex, int PageSize) {
		// TODO Auto-generated method stub
		Page page = eTypeDao.qryETypes(padeIndex, PageSize);
		return page;
	}

	@Override
	public Page getPageETypes(int padeIndex, int PageSize, String name) {
		// TODO Auto-generated method stub
		Page page = eTypeDao.qryETypes(padeIndex, PageSize, name);
		return page;
	}

	@Override
	public List<EType> getETypes() {
		// TODO Auto-generated method stub
		List<EType> eTypes = eTypeDao.qryETypes();
		return eTypes.size() > 0 ? eTypes : null;
	}

}
